package com.atguigu.spzx.common.config;

import com.atguigu.spzx.common.Interceptor.SpzxUserInfoInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class SpzxWebMvcConfigure implements WebMvcConfigurer {
    @Resource
    SpzxUserInfoInterceptor spzxUserInfoInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(spzxUserInfoInterceptor)
                .addPathPatterns("/api/**/auth/**");
    }
}